<template>
  <div class="job-card" @click="handleClick">
    <div class="job-title">{{ title }}</div>
    <div class="job-company">{{ company }}</div>
    <div class="job-location">{{ location }}</div>
    <div class="job-salary">{{ salary }}</div>
  </div>
</template>

<script setup>
// 移除导入语句
const props = defineProps({
  title: {
    type: String,
    default: ''
  },
  company: {
    type: String,
    default: ''
  },
  location: {
    type: String,
    default: ''
  },
  salary: {
    type: String,
    default: ''
  }
});
const emits = defineEmits(['click']);

const handleClick = () => {
  emits('click', props.title);
};
</script>

<style scoped>
.job-card {
  padding: 1.2rem;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin-bottom: 1rem;
  cursor: pointer;
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}
.job-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.job-company {
  font-size: 0.925rem;
  color: #4a5568;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.job-company::before {
  content: "🏢";
  font-size: 0.9em;
}

.job-location {
  font-size: 0.925rem;
  color: #718096;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.job-location::before {
  content: "📍";
  font-size: 0.9em;
}

.job-salary {
  font-size: 1.1rem;
  font-weight: 600;
  color: #10b981;
  background: #ecfdf5;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  align-self: flex-start;
  margin-top: 0.4rem;
}
@media (min-width: 640px) {
  .job-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1.2rem;
  }
  
  .job-title {
    width: 100%;
  }
  
  .job-salary {
    margin-left: auto;
  }
}
.job-card {
  position: relative;
  overflow: hidden;
}

.job-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 123, 255, 0.05);
  opacity: 0;
  transition: opacity 0.2s;
}

.job-card:hover::after {
  opacity: 1;
}
</style>    